package com.gbei.center.oauth.mapper;

import com.gbei.center.oauth.model.AuthAccessToken;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;
import tk.mybatis.mapper.common.Mapper;

@Component
public interface AuthAccessTokenMapper extends Mapper<AuthAccessToken> {

    /**
     * 通过userId + clientId + scope查询记录
     * @param userId 用户ID
     * @param clientId 接入的客户端ID
     * @param grantType grantType
     * @return AuthAccessToken
     */
    AuthAccessToken selectByUserIdClientIdScope(@Param("userId") String userId, @Param("clientId") String clientId, @Param("grantType") String grantType);

    /**
     * 通过Access Token查询记录
     * @param accessToken Access Token
     * @return AuthAccessToken
     */
    AuthAccessToken selectByAccessToken(@Param("accessToken") String accessToken);
}